//
//  WQCFastViewController.m
//  renxinghuan
//
//  Created by 王晓民 on 2018/3/21.
//  Copyright © 2018年 吴清翠. All rights reserved.
//

#import "WQCFastViewController.h"
#import "configuration.h"
#import "WQCChoiceViewController.h"//选择信用卡
@interface WQCFastViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,strong)UITableView *fastTabeleView;

@end

@implementation WQCFastViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBarHidden =NO;

    self.view.backgroundColor = WYCGlobalBg;
    [self setupNav];
    UIView  *footView = [MyUIClass makeUIViewWithFram:CGRectMake(0, 0, ScreenWidth, 120) andBackColor:[UIColor clearColor]];

    self.fastTabeleView = [[UITableView alloc] initWithFrame:CGRectMake(0, -20, kScreenW, kScreenH) style:UITableViewStyleGrouped];
    self.fastTabeleView.dataSource = self;
    self.fastTabeleView.delegate = self;
    self.fastTabeleView.tableFooterView = footView;
    self.fastTabeleView.sectionFooterHeight = 10;
    self.fastTabeleView.sectionHeaderHeight = 10;
    [self.view addSubview:self.fastTabeleView];
    
    UILabel  *noticeLb= [MyUIClass makeUILabelWithFrame:CGRectMake(10, 10, ScreenWidth-20, 20) andBackColor:[UIColor clearColor] andText:@"温馨提示：为了您的账户安全，单笔消费不得超过2万元" andTextColor:[UIColor lightGrayColor] andFont:[UIFont systemFontOfSize:14] andAlignment:NSTextAlignmentLeft];
    [footView addSubview:noticeLb];
    
    UIButton  *btnFast = [MyUIClass makeUIButtonWithFrame:CGRectMake(30, 80, ScreenWidth-60, 44) andType:UIButtonTypeRoundedRect andTitle:@"确定" andImageName:@"" andTarget:self andSelector:@selector(pressFast) andEvent:UIControlEventTouchUpInside andState:UIControlStateNormal];
    btnFast.layer.cornerRadius = 10 * px;
    btnFast.layer.masksToBounds = YES;
    [btnFast setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    btnFast.backgroundColor = wycMain;
    [footView addSubview:btnFast];
}
- (void)setupNav {
    
    [self.navigationController.navigationBar setBarTintColor:wycMain];
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    self.navigationItem.title = @"快速消费";
}
#pragma mark - TableView DataSource Method

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0)
    {
        return 60;
    }
    else
    return 146;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString * strID = @"cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:strID];
    
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:strID];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    if (indexPath.section == 0) {
           cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; //显示最右边的箭头
        UIImageView *bankImg = [MyUIClass makeUIImageViewWithFrame:CGRectMake(20, 10, 35, 35) andImage:@"bank_icon_zs"];
        [cell.contentView addSubview:bankImg];
        
        UILabel *label= [MyUIClass makeUILabelWithFrame:CGRectMake(80, 10, 120, 20) andBackColor:[UIColor clearColor] andText:@"招商银行" andTextColor:[UIColor blackColor ] andFont:[UIFont systemFontOfSize:18] andAlignment:NSTextAlignmentLeft];
        [cell.contentView addSubview:label];
        UILabel *timelabel= [MyUIClass makeUILabelWithFrame:CGRectMake(80, 35, 120, 20) andBackColor:[UIColor clearColor] andText:@"*旭东 2236信用卡" andTextColor:[UIColor lightGrayColor] andFont:[UIFont systemFontOfSize:14] andAlignment:NSTextAlignmentLeft];
        [cell.contentView addSubview:timelabel];
      
    }
    if (indexPath.section == 1) {
        UILabel *banklabel= [MyUIClass makeUILabelWithFrame:CGRectMake(20, 15, 80, 20) andBackColor:[UIColor clearColor] andText:@"消费金额" andTextColor:[UIColor blackColor ] andFont:[UIFont systemFontOfSize:18] andAlignment:NSTextAlignmentLeft];
        [cell.contentView addSubview:banklabel];
        
        UILabel *feelabel= [MyUIClass makeUILabelWithFrame:CGRectMake(100, 15, 120, 20) andBackColor:[UIColor clearColor] andText:@"(每笔消费收取1元手续费)" andTextColor:[UIColor lightGrayColor ] andFont:[UIFont systemFontOfSize:15] andAlignment:NSTextAlignmentLeft];
        [cell.contentView addSubview:feelabel];
//        UITextField  *textMoney = [MyUIClass makeUITextFieldWithFrame:CGRectMake(0, 0, 0, 0) andDelegate:self andBorderStyle:UITextBorderStyleNone andPlaceholder:@"" andAutocorrectionType:nil andAutocapitalizationType:nil andClearButtonMode:nil andSecureTextEntry:NO andKeyboardType:UIKeyboardTypeNumberPad andReturnKeyType:UIReturnKeyDone];
        
        UILabel *amountlabel= [MyUIClass makeUILabelWithFrame:CGRectMake(20, 65, 200, 20) andBackColor:[UIColor clearColor] andText:@"入账卡为建设银行（6868）储蓄卡" andTextColor:[UIColor lightGrayColor ] andFont:[UIFont systemFontOfSize:15] andAlignment:NSTextAlignmentLeft];
        [cell.contentView addSubview:amountlabel];
        
        
    }
    
    
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section==0) {
        WQCChoiceViewController *choiceView = [[WQCChoiceViewController alloc]init];
        [self.navigationController pushViewController:choiceView animated:YES];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
